package xyz.ddlnt.user.mq.publisher;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.*;
import xyz.ddlnt.commonutil.constant.MqConstants;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/28 3:06
 */
@Slf4j
@Tag(name = "mq_帖子评论接口测试")
@RestController
@RequestMapping("/mq/post_comment")
public class PostCommentPublisher {
    @Resource
    private RabbitTemplate rabbitTemplate;

    @Operation(summary = "一级评论的回复数+1")
    @PutMapping("/plusOne/{id}")
    public void postCommentPlusOne(@PathVariable Long id) {
        rabbitTemplate.convertAndSend(MqConstants.USR_POST_COMMENT, MqConstants.COMMENT_COUNT_PLUS_ONE, id);
    }
}
